<template>
	<nt-container>
		<view class="nt-index">
			<input type="text" v-model="model.name" placeholder="请输入用户名" />
			<input type="text" v-model="model.pass" placeholder="请输入密码" />
			<nt-button text="临时登录测试" @click="memberLogin"></nt-button>
			
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			
			
			
			<nt-button text="详情提交" @click="nav('/subpackage/order/pages/submit/_id')"></nt-button>
			<br>
			<nt-button text="维修详情" @click="nav('/subpackage/order/pages/submit/recovery')"></nt-button>
		</view>
	</nt-container>
</template>

<script>
	import { nav } from "@/utils"
	export default {
		data() {
			return {
				title: 'Hello',
				rules: [],
				model: {
					name: "13827610385",
					pass: "821765"
				}
			}
		},
		onLoad() {
			// this.memberLogin()
		},
		methods: {
			nav,
			memberLogin() {
				if(!this.model.name) return uni.showToast({
					icon:"none",
					title: "请输入登录账号"
				})
				if(!this.model.pass) return uni.showToast({
					icon:"none",
					title: "请输入登录密码"
				})
				// '821765'
				this.$store.dispatch('user/userLogin', this.model)
				// userLogin(this.model.name, this.model.pass).then(res => {
				// 	console.log(res,'登录')
				// 	if(res.data.code === 0) return uni.showToast({
				// 		icon:"none",
				// 		title: res.data.msg
				// 	})
				// })
			}
		}
	}
</script>

<style scoped lang="scss">
.nt-index{
	padding: 30rpx;
	box-sizing: border-box;
	input{
		width: 100%;
		height: 90rpx;
		background:#fff;
		padding: 0 20rpx;
		box-sizing: border-box;
		border-radius: 10rpx;
		margin-bottom: 30rpx;
	}
}
</style>
